use UMAS0007b_OUTPUT.dta, clear

gen cb_vs_db=Q6a if candidateb1=="Donald Berwick"
gen cb_vs_jk=Q6a if candidateb1=="Juliette Kayeem"
gen cb_vs_mc=Q6a if candidateb1=="Martha Coakley"
gen cb_vs_sg=Q6a if candidateb1=="Steve Grossman"

replace cb_vs_db=Q6b if candidateb2=="Donald Berwick"
replace cb_vs_jk=Q6b if candidateb2=="Juliette Kayeem"
replace cb_vs_mc=Q6b if candidateb2=="Martha Coakley"
replace cb_vs_sg=Q6b if candidateb2=="Steve Grossman"

replace cb_vs_db=Q6c if candidateb3=="Donald Berwick"
replace cb_vs_jk=Q6c if candidateb3=="Juliette Kayeem"
replace cb_vs_mc=Q6c if candidateb3=="Martha Coakley"
replace cb_vs_sg=Q6c if candidateb3=="Steve Grossman"

replace cb_vs_db=Q6d if candidateb4=="Donald Berwick"
replace cb_vs_jk=Q6d if candidateb4=="Juliette Kayeem"
replace cb_vs_mc=Q6d if candidateb4=="Martha Coakley"
replace cb_vs_sg=Q6d if candidateb4=="Steve Grossman"

label define berwick 1 "Baker" 2 "Berwick" 3 "Not sure"
label define kayeem 1 "Baker" 2 "Kayeem" 3 "Not sure"
label define coakley 1 "Baker" 2 "Coakley" 3 "Not sure"
label define grossman 1 "Baker" 2 "Grossman" 3 "Not sure"

label values cb_vs_db berwick
label values cb_vs_jk kayeem
label values cb_vs_mc coakley
label values cb_vs_sg grossman

recode cb_vs_db-cb_vs_sg (4=.)


svyset [pw=weight]

***************
* Governor Results
***************

*Right direction/wrong track
svy: tab Q1
svy: tab Q2

* Patrick record
svy: tab Q4, stubw(30)

* Democratic Primary Preferences
svy: tab Q5a if Q5a<7, stubw(30)

* General Election Trial Heats
svy: tab cb_vs_db
svy: tab cb_vs_jk
svy: tab cb_vs_mc
svy: tab cb_vs_sg

recode Q12_ew-Q12_jk (997=.)


***************
* Tale of two senators Results
***************

* Approval
svy: tab app_dp
svy: tab app_ew
svy: tab app_em

* Best Senator
svy: tab Q10, stubw(30)
svy: tab Q11, stubw(30)

* Senator traits
svy: tab Q15a
svy: tab Q15b
svy: tab Q15c
svy: tab Q15d
svy: tab Q15e

* Present?
svy: tab Q16, stubw(30)




